﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<BGCMS.Models.HealthLog>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Heilsufarsskrá
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="leftside">
    <h2>Barnið mitt</h2>
        <ul>
            <li>
                <%: Html.ActionLink("Skrá barn", "CreateChild", "Child") %></li>
            <li>
                <%: Html.ActionLink("Breyta barni", "EditChild", new { id = Model.FirstOrDefault().ChildID}) %></li>
            <li>
                <%: Html.ActionLink("Tímalína barns", "Child", new { id = Model.FirstOrDefault().ChildID })%></li>
            <li>
                <%: Html.ActionLink("Heilsufarsskrá", "HealthLog", new { id = Model.FirstOrDefault().ChildID })%></li>
            <li>
                <%: Html.ActionLink("Bólusetningar", "VaccinationLog", new { id = Model.FirstOrDefault().ChildID })%></li>
            <li>
                <%: Html.ActionLink("Tímapantanir", "AppointmentLog", new { id = Model.FirstOrDefault().ChildID })%></li>
            <li>
                <%: Html.ActionLink("WHO kúrva","Graph","Home") %></li>
        </ul>
    </div>
    <div id="content">
        <h2>
            Heilsufarsskrá</h2>
        <table class="tafla">
            <thead>
                <tr>
                    <th>
                        Dagsetning
                    </th>
                    <th>
                        Þyngd (kg)
                    </th>
                    <th>
                        Hæð (cm)
                    </th>
                    <th>
                        Ummál höfuðs (cm)
                    </th>
                    <th>
                        Athugasemdir
                    </th>
                    <th>
                    </th>
                    <th>
                    </th>
                </tr>
            </thead>
            <tbody>
                <% foreach (var h in Model) { %>
                    <tr>
                        <td><%: h.DateOfCheck.ToString("dd/MM/yyyy") %></td>
                        <td><%: h.Weight %></td>
                        <td><%: h.Height %></td>
                        <td><%: h.HeadCircumreference %></td>
                        <td><%: h.Comment %></td>
                        <td><%: Html.ActionLink("Breyta", "EditHealthLogItem", new { h.ID }) %></td>
                        <td><%: Html.ActionLink("Eyða", "DeleteHealthLogItem", new { h.ID }) %></td>
                        <!--<td><a href="/Child/HealthLog/<%: h.ChildID %>" onclick="deleteHealth(<%: h.ID %>)">Eyða</a></td>-->
                    </tr>
                <% } %>
            </tbody>
        </table>
        <p>
            <%: Html.ActionLink("Skrá nýja mælingu", "CreateHealthLogItem", new { id = Model.FirstOrDefault().ChildID }) %>
        </p>
    </div>
</asp:Content>